Getting Linux
For the beginning of the course, the student will be using a Knoppix live CD. This will let you work in a Linux environment without having to install anything. Later, there will be instructions on how to install Linux.
There are several methods to obtaining a Linux distro to work through the course with, each with their own advantages and disadvantages. The simplest is to obtain a live CD, which will run Linux using only the CD and a computer's RAM. The disadvantages are that the CD drive must be bootable and one can still mount and alter (erase, corrupt, etc.) hard drives.
Another method is to run a virtual machine from an already installed operating system. This will allow for a quarantined Linux without altering an already present operating system. However, It does require enough resources to run both operating systems. VirtualBox and images for various Linux distros are freely available.
Doing a full install of a Linux distro is also an option. There are many distros that have very user friendly graphical installers along with thorough installation guides. This method is more permanent and less flexible. To keep an old operating system from being overwritten it will require more skill. .Due to the more technical and permanent nature of this method, it will not be covered until later in the course.
Recommended: Virtual Machine
Virtual machines will allow for a quick and simple setup. Virtualbox is freely available at virtualbox.org for Windows, OSX, and Linux. Download, install, and open it.
Minimally, you'll need 512M of RAM, but in reality, you should have enough RAM to comfortably run the host operating system as well as the guest operating system, which will differ depending on which operating systems are being used. Processors follow the same rule: enough speed for both operating systems. Multicore processors will be a blessing here. There should also be enough disk space for both operating systems to use. Plan for several gigabytes to be used by each operating system.
One can find many premade images to load at virtualboxes.org/images/. Be sure to note the usernames and passwords that go along with the images. Once you've downloaded an image, unzip it and add it as a virtual machine by selecting the .vdi file when creating a new virtual machine.
Because premade machines are sometimes set up in ways that won't work for a specific system (due to incompatable boot options, etc.), an alternative is to place a Live CD .iso into the virtual machine's fake CD rom drive. This will automatically configure the system at boot and is a bit more reliable than a premade virtual machine. The downside is that the OS starts fresh every time it's booted, so no changes are saved.
Open VirtualBox and follow along with this video.
As seen in the video, VirtualBox can have several virtual machines installed, allowing you to have multiple Linux distros. Repeat the steps in the video to add additional virtual machines.
Live CD
There are many Live CDs available. One prominent example is Knoppix. This section will go over how to obtain and boot into Knoppix.
One detail to note when downloading a live CD or an installation CD is the architecture. Programs that are compiled for one architecture will not work on another. Most desktop computers run on the x86 or x86_64 architecture. Look up what architecture your processor uses to be sure. Pre-Intel Macs use the PPC architecture. Other architectures are mostly for servers or embedded devices. If you need one of those, you'll know it. Knoppix will run on any x86 architecture. For the duration of the course, it is assumed the student is on an x86 computer. Other Live CDs are available for other architectures. Aside from an x86 processor, you'll need 120 MB RAM (500MB is recommended) and a CD rom. No disk space is required as all files are read from the CD.
To obtain a Knoppix CD:
- Download and burn an image from one of the mirrors listed at: http://knopper.net/knoppix-mirrors/index-en.html
- Pop it in the CDROM and reboot. Hardware will generally be automatically and correctly configured.
- After you are done using a live CD, shutdown the system and take the CD out of the drive to boot into the computer’s installed OS.
Alternatively, Live CD isos may also be placed in a virtual CD rom drive in a virtual machine for the ease of a Live CD combined with the compartmentalization of virtual machines until you're ready to perform a virtual or actual install. This is also a viable alternative to premade virtual machines which may not work out of the box.
Getting used to Linux
Now that you're in Linux, there are a few things you'll have to get used to.
- Case sensitivity: Everything in Linux is case sensitive. This means that typing ls is completely different from typing LS on the command line (unlike the command lines that are available in Windows).
- User Accounts: A user must log in to do anything before performing any actions. This prevents anybody without a login from accessing the system.
- The terminal: (shell, command line, CLI) usually accessed by opening a terminal emulator. In Knoppix, this is one of the icons on the bottom left of the GUI. Click it and a terminal will appear.While there are many GUI programs available to perform administrative functions, there are many things the terminal does better. While it requires some getting used to, soon a trained user will find that the terminal is faster and easier than GUIs. It can also be used in circumstances that a GUI cannot be used in.
- Paths: File locations are indicated by using forward slashes and begin with a forward slash (/). For example: /usr/bin/perl. The first slash represents the root directory, under which everything is organized. This example points to a file called perl in the bin directory, which is in the usr directory. Files have very few naming restrictions and often have no extension associated with them.
- Permissions: Each file, including programs, has permissions associated with it. These Permissions dictate what users can perform what actions which actions a user can perform on a given file. These will be covered in greater detail later in the course, but for now, know that there are many actions that only the root user is allowed to do. just get used to the fact that only the root user can do many things.
- Superuser Accounts: The root user , or just root,(oftentimes referred to as root) is the administrator account. Root may do anything, including irreparably destroying the OS. Other users, however, will have a difficult time harming anything outside of their home directory. It is recommended NOT to use the root account, unless there is very good reason. It is also standard practice never to directly log in as root, but to log in as a user and su (a command that allows users to switch accounts) to root. Another good option is to use sudo to run programs that require root privileges. These commands and others will be covered later in the course.
root (the superuser) and / (the root directory) have only their names in common and are otherwise unrelated.
Course Conventions
This course will use several conventions:
Though GNU/Linux is the de jure proper naming convention for the operating system to be discussed, this is shortened to Linux for both ease and because it has become the de facto name for GNU/Linux. For more background information about this, see the GNU Operating System website.
Text that is to be entered on the command line will appear as follows:
- for a user, the prompt will be represented with a dollar sign ($):
$ ls -a
- for the root user, the prompt will be represented with a hash (#):
# vi fstab
Text that the user will fill in appropriately will be in italics and optional text to be entered will be in [square brackets]. This mirrors conventions used in the man page synopsis section.
Examples will usually use the traditional placeholders of foo, bar, baz, and qux. These are not actual files and should always be taken as examples.
Because Linux is case sensitive, some sentences will begin with a lower case letter to preserve correct capitalization of commands and so forth.
Many Linux commands have options that are not covered in this course because they are useful in only certain cases. If the text says to read the man page, follow instructions. Man pages need not be memorized, but they will prove extremely useful while learning about commands. Man pages serve as an excellent reference for those well on their way toward mastery.